(ns zesql.samples
  (:require [zesql.core :as zs :refer [defqueries]]))

(zs/debug-on!)
;(zs/dynamic-off!)

(def db-spec
  {:classname   "org.h2.Driver"
   :subprotocol "h2"
   :subname     "./zesql"
   :make-pool?  true
   :naming      {:keys   clojure.string/lower-case
                 :fields clojure.string/upper-case}})

(def delay-spec (delay
                  (println "delay spec")
                  db-spec))


(defqueries "zesql/query-static.sql" {:connection delay-spec})
(println "-------------")

(println (testsql))

(println (test-where {:id 2 :name "bbb"}))

(println (test-set! {:id 3 :name "abc" :age 28}))